package com.xyzboom.compiler.compiler.semantic

import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.module.kotlin.jsonMapper
import com.xyzboom.compiler.compiler.ast.assertASTNodeType
import com.xyzboom.compiler.compiler.ast.getGlobalDef
import com.xyzboom.compiler.compiler.ast.getSemExprs
import com.xyzboom.compiler.compiler.ast.getSemGrammarProductions
import com.xyzboom.compiler.compiler.grammar.ASTNode
import com.xyzboom.compiler.compiler.grammar.Grammar2
import com.xyzboom.compiler.compiler.grammar.NonTerminator
import com.xyzboom.compiler.compiler.grammar.Production
import com.xyzboom.compiler.compiler.lexer.LexerRule
import com.xyzboom.compiler.compiler.lexer.parseCode
import com.xyzboom.compiler.compiler.lr.PredictTable
import com.xyzboom.compiler.compiler.lr.SEM_GRAMMAR_NAME

/**
 * Sem grammar
 *
 * @property semantics semantics with specified production
 * @property globalDef global definitions
 * @constructor
 *
 * @param start
 * @param productions
 */
class SemGrammar(
    start: NonTerminator,
    productions: ArrayList<Production>,
    val semantics: ArrayList<String>,
    val globalDef: String?,
) : Grammar2(start, productions) {
    companion object {
        private val lexerRules =
            jsonMapper().readerFor(object : TypeReference<List<LexerRule>>() {})
                .readValue<List<LexerRule>>(
                    "[{\"name\":\"kotlinCode\",\"typeName\":\"CODE\",\"dfa\":{\"i\":0,\"e\":[7],\"m\":{\"0\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":3},\"1\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":2},\"2\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":7},\"3\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":6},\"4\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":8,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"1\\\",\\\"value\\\":\\\".\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":5,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":9},\"5\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":8,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"1\\\",\\\"value\\\":\\\".\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":5,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":9},\"6\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":4},\"8\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":8,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"1\\\",\\\"value\\\":\\\".\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":5,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":9},\"9\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":8,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"*\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"1\\\",\\\"value\\\":\\\".\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":5,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":9}}},\"greedy\":false},{\"name\":\"space\",\"typeName\":\"SPACE\",\"dfa\":{\"i\":0,\"e\":[1],\"m\":{\"0\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\t\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\" \\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\f\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\u000B\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1},\"1\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\t\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\" \\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\f\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"\\\\u000B\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1}}},\"greedy\":true},{\"name\":\"letters\",\"typeName\":\"NONE\",\"dfa\":{\"i\":0,\"e\":[1],\"m\":{\"0\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"j\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"I\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"f\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"E\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Q\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"M\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Z\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"w\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"V\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"s\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"b\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"A\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"i\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"H\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"e\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"D\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"q\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"P\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"m\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"L\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"z\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Y\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"v\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"U\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"a\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"h\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"G\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"d\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"C\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"p\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"O\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"l\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"K\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"y\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"X\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"u\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"T\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"J\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"g\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"F\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"c\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"R\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"o\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"N\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"k\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"x\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"W\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"t\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"S\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"B\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1},\"1\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"j\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"I\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"f\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"E\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Q\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"M\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Z\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"w\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"V\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"s\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"b\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"A\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"i\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"H\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"e\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"D\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"q\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"P\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"m\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"L\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"z\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Y\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"v\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"U\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"a\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"h\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"G\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"d\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"C\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"p\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"O\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"l\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"K\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"y\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"X\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"u\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"T\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"J\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"g\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"F\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"c\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"R\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"o\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"N\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"k\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"x\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"W\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"t\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"S\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"B\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1}}},\"greedy\":true},{\"name\":\"numbers\",\"typeName\":\"NONE\",\"dfa\":{\"i\":0,\"e\":[1],\"m\":{\"0\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"9\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"8\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"7\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"6\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"5\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"4\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"3\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"2\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"1\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"0\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1},\"1\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"9\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"8\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"7\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"6\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"5\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"4\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"3\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"2\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"1\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"0\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1}}},\"greedy\":true},{\"name\":\"id\",\"typeName\":\"ID\",\"dfa\":{\"i\":0,\"e\":[1],\"m\":{\"0\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"j\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"I\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"f\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"E\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Q\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"M\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Z\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"w\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"V\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"s\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"b\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"A\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"i\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"H\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"e\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"D\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"q\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"P\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"m\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"L\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"z\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Y\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"v\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"U\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"a\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"h\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"G\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"d\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"C\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"p\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"O\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"l\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"K\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"y\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"X\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"u\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"T\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"J\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"g\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"F\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"c\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"R\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"o\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"N\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"k\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"x\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"W\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"t\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"S\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"B\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"_\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1},\"1\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"j\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"I\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"f\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"E\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"r\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Q\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"0\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"n\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"M\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Z\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"9\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"w\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"V\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"5\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"s\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"b\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"A\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"i\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"H\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"e\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"D\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"q\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"P\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"m\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"L\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"z\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"Y\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"8\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"v\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"U\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"4\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"a\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"h\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"G\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"d\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"C\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"2\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"p\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"O\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"l\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"K\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"y\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"X\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"7\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"u\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"T\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"3\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"J\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"g\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"F\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"c\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"R\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"1\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"o\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"N\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"k\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"x\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"W\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"6\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"t\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"S\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"B\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1,\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"_\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1}}},\"greedy\":true},{\"name\":\"colon\",\"typeName\":\"SPLIT\",\"dfa\":{\"i\":0,\"e\":[1],\"m\":{\"0\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\":\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1}}},\"greedy\":true},{\"name\":\"semicolon\",\"typeName\":\"SPLIT\",\"dfa\":{\"i\":0,\"e\":[1],\"m\":{\"0\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\";\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1}}},\"greedy\":true},{\"name\":\"or\",\"typeName\":\"SPLIT\",\"dfa\":{\"i\":0,\"e\":[1],\"m\":{\"0\":{\"{\\\"type\\\":\\\"0\\\",\\\"value\\\":\\\"|\\\",\\\"@K-Class\\\":\\\"java.lang.Character\\\"}\":1}}},\"greedy\":true}]"
                )
        private val semGrammarPredictTable =
            jsonMapper().readerFor(PredictTable::class.java)
                .readValue<PredictTable>(
                    "{\"@class\":\"com.xyzboom.compiler.compiler.lr.PredictTable\",\"productions\":[{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"SemGrammar\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prods\"}]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"SemGrammar\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prods\"},{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"GlobalDef\"}]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prods\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prod\"}]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prods\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prod\"},{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prods\"}]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prod\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.Terminator\",\"tokenName\":\"id\"},{\"type\":\"com.xyzboom.compiler.compiler.grammar.Terminator\",\"tokenName\":\"colon\"},{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prod_right\"},{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"SemExprs\"},{\"type\":\"com.xyzboom.compiler.compiler.grammar.Terminator\",\"tokenName\":\"semicolon\"}]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Prod_right\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Ids\"}]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Ids\"},\"right\":[]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Ids\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.Terminator\",\"tokenName\":\"id\"},{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"Ids\"}]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"SemExprs\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.Terminator\",\"tokenName\":\"kotlinCode\"}]},{\"left\":{\"type\":\"com.xyzboom.compiler.compiler.grammar.NonTerminator\",\"name\":\"GlobalDef\"},\"right\":[{\"type\":\"com.xyzboom.compiler.compiler.grammar.Terminator\",\"tokenName\":\"kotlinCode\"}]}],\"dfa\":{\"i\":0,\"e\":[],\"m\":{\"0\":{\"{\\\"type\\\":\\\"3\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"id\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":4,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"Prod\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":3,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"Prods\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":1,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"SemGrammar\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":2},\"1\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":0,\"{\\\"type\\\":\\\"3\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":6,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"GlobalDef\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":5},\"2\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":-1},\"3\":{\"{\\\"type\\\":\\\"3\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"id\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":4,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"Prod\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":3,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"Prods\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":7,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":2,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":2},\"4\":{\"{\\\"type\\\":\\\"3\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"colon\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":8},\"5\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":1},\"6\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":9},\"7\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":3,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":3},\"8\":{\"{\\\"type\\\":\\\"3\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"id\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":11,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":6,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":6,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"Prod_right\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":9,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"Ids\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":10},\"9\":{\"{\\\"type\\\":\\\"3\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":13,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"SemExprs\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":12},\"10\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":5,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":5},\"11\":{\"{\\\"type\\\":\\\"3\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"id\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":11,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":6,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":6,\"{\\\"type\\\":\\\"5\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\",\\\"name\\\":\\\"Ids\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.NonTerminator\\\"}\":14},\"12\":{\"{\\\"type\\\":\\\"3\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"semicolon\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":15},\"13\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"semicolon\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":8},\"14\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":7,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":7},\"15\":{\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"id\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":4,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"#\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":4,\"{\\\"type\\\":\\\"4\\\",\\\"value\\\":{\\\"type\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\",\\\"tokenName\\\":\\\"kotlinCode\\\"},\\\"@K-Class\\\":\\\"com.xyzboom.compiler.compiler.grammar.Terminator\\\"}\":4}}}}"
                )
        private val semGrammarSkipTokens = hashSetOf(
            "space",
        )

        fun semGrammarFromText(str: String): SemGrammar {
            val tokens = parseCode(str, lexerRules)
            return semGrammarPredictTable.generatorAST(tokens, semGrammarSkipTokens).getSemGrammar()
        }

        private fun ASTNode.getSemGrammar(): SemGrammar {
            val prods = getSemGrammarProductions(ArrayList())
            assertASTNodeType(SEM_GRAMMAR_NAME)
            return SemGrammar(prods[0].left, prods, getSemExprs(), getGlobalDef())
        }
    }
}